#!/usr/bin/python
#-*- coding: utf-8 -*-

import sys

def read_and_sort_obj_content(obj_file):
    """Return Dictionary mit Indizierten Vertices und Normalen sowie einer Liste der faces mit Indizes"""

def get_faces_coordinates(indexed_data, faces):
    """Return Liste von Faces mit Punktkoordinaten anstelle von Indizes"""
    
                         
def init_geometry_from_obj_file(obj_file):
    """Return Tupel von allen fuer OpenGL/VBO benoetigten (Punkt) Listen"""

    lines = [line.split() for line in file(obj_file)]
    
    vertices = []
    vertice_textures = []
    vertex_norms = []
    faces = []

    for line in lines:
        if line: 
            if line[0] == 'v':
                vertices.append(map(float, line[1:]))
            if line[0] == 'vn':
                vertex_norms.append(map(float, line[1:]))
            if line[0] == 'f':
                faces.append(line[1:])
                
    print vertices[:3]
    print vertex_norms[:3]
    print faces[:3]

    return zip(
    
            
    
def main():
    f_name = 'bunny.obj'
    init_geometry_from_obj_file(f_name)
    
if __name__=='__main__':
    main()
    
    
        
